<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>TODO supply a title</title>
    </h:head>
    <h:body>
        <ui:composition template="./HomeTemp.xhtml">
            <ui:define name="eventcontent">
                
                <h:outputText value="#{loginBean.userLogin}"></h:outputText>
            </ui:define>
            <ui:define name="listevent">
                <div style="width: 78%">
                <h:form id="form" prependId="false">  
                    <p:dataTable var="event" value="#{eventBean.eventListAll}" rowKey="#{event.eventID}" paginator="true" rows="10" selection="#{eventBean.eventEntities}" selectionMode="single" widgetVar="userTbl" emptyMessage="No user record was found" id="eventTable">

                        <p:ajax event="rowSelect" update=":form:display" oncomplete="eventDialog.show()" />                 

                        <f:facet name="header">                
                            <h:outputLabel value="List of Event"/> <br/> 
                        </f:facet>                                

                        <p:column headerText="Event Name" sortBy="#{event.eventName}" filterBy="#{event.eventName}" footerText="contains" filterMatchMode="contains" id="eventname">
                            <p:cellEditor>
                                <f:facet name="output">  
                                    <h:outputText value="#{event.eventName}" />  
                                </f:facet>  
                                <f:facet name="input">  
                                    <h:outputText value="#{event.eventName}" style="width:100%"/>  
                                </f:facet>
                            </p:cellEditor>
                        </p:column>
                        <p:column headerText="Start Date" sortBy="#{event.startDate}" filterBy="#{event.startDate}" footerText="contains" filterMatchMode="contains" id="eventstartdate">
                            <p:cellEditor>
                                <f:facet name="output">  
                                    <h:outputText value="#{event.startDate}" />  
                                </f:facet>  
                                <f:facet name="input">  
                                    <h:outputText value="#{event.startDate}" style="width:100%"/>  
                                </f:facet>
                            </p:cellEditor>
                        </p:column>
                        <p:column headerText="Start Date" sortBy="#{event.endDate}" filterBy="#{event.endDate}" footerText="contains" filterMatchMode="contains" id="eventenddate">
                            <p:cellEditor>
                                <f:facet name="output">  
                                    <h:outputText value="#{event.endDate}" />  
                                </f:facet>  
                                <f:facet name="input">  
                                    <h:outputText value="#{event.endDate}" style="width:100%"/>  
                                </f:facet>
                            </p:cellEditor>
                        </p:column>
                        <p:column headerText="Start Date" sortBy="#{event.address}" filterBy="#{event.address}" footerText="contains" filterMatchMode="contains" id="eventaddress">
                            <p:cellEditor>
                                <f:facet name="output">  
                                    <h:outputText value="#{event.address}" />  
                                </f:facet>  
                                <f:facet name="input">  
                                    <h:outputText value="#{event.address}" style="width:100%"/>  
                                </f:facet>
                            </p:cellEditor>
                        </p:column>
                        <p:column headerText="Start Date" sortBy="#{event.description}" filterBy="#{event.description}" footerText="contains" filterMatchMode="contains" id="eventdescription">
                            <p:cellEditor>
                                <f:facet name="output">  
                                    <h:outputText value="#{event.description}" />  
                                </f:facet>  
                                <f:facet name="input">  
                                    <h:outputText value="#{event.description}" style="width:100%"/>  
                                </f:facet>
                            </p:cellEditor>
                        </p:column>
                        
                    </p:dataTable>
                
                
                    <p:dialog header="User Detail" widgetVar="eventDialog" resizable="true" width="422" showEffect="explode" hideEffect="explode">
                        <h:panelGrid id="display" columns="2" cellpadding="4"> 
                            <h:outputText value="Event Name: " />  
                            <h:outputText value="#{eventBean.eventEntities.eventName}" id="eventName"/>
                            <h:outputText value="Start Date: " />  
                            <h:outputText value="#{eventBean.eventEntities.startDate}" id="startDate"/>
                            <h:outputText value="End Date: " />  
                            <h:outputText value="#{eventBean.eventEntities.endDate}" id="endDate"/>
                            <h:outputText value="Address: " />  
                            <h:outputText value="#{eventBean.eventEntities.address}" id="address"/>
                            <h:outputText value="Description: " />  
                            <h:outputText value="#{eventBean.eventEntities.description}" id="description"/>
                            <h:outputText value="Price: " />  
                            <h:outputText value="#{eventBean.eventEntities.price}" id="price"/>
                            <h:outputText value="Name Win: " />  
                            <h:outputText value="#{eventBean.eventEntities.nameWin}" id="nameWin"/>
                        </h:panelGrid>
                    </p:dialog>
                </h:form>
                </div>
            </ui:define>
            </ui:composition>
    </h:body>
</html>
